package edu.gatech.cs2340.group7.wheresmystuffapp.junit;

import junit.framework.TestCase;
import edu.gatech.cs2340.group7.wheresmystuffapp.model.ItemLocation;
import edu.gatech.cs2340.group7.wheresmystuffapp.presenters.ReportLostItemPresenter;
import edu.gatech.cs2340.group7.wheresmystuffapp.views.ReportLostItemView;


public class ReportLostItemPresenterTest extends TestCase {

	ReportLostItemPresenter activity = new ReportLostItemPresenter(new ReportLostItemView());
	byte[] arr = null;
	ItemLocation il = new ItemLocation(33, -84);

	public ReportLostItemPresenterTest() {
		super();
	}

	public void setUp() throws Exception {
		super.setUp();
	}

	public void tearDown() throws Exception {
		super.tearDown();
	}

	/**
	 * This will test that the app can add an item
	 */
	//public void addItem(String itemName, String description, String category,
	//String location, CustomDate dateLost, String reward, String picture)
	//
	public void testCorrectAdding() {
		long test = activity.addItem("Test Item", "A J-Unit Test Item", "Misc", il, "01-01-2012", "2", arr);
		assertTrue("Item is added correctly",test != -1);		
	}
	
	/**
	 * This will test to make sure the app will not add an item with no name
	 */
	public void testNoName(){
		long test = activity.addItem(null, "A J-Unit test item", "Misc", il, "01-01-2012", "2", arr);
		assertTrue("Addin an Item failed, asks for a name",test == -1);		
	}
	
	/**
	 * This will test to make sure the app will not add an item with no description
	 */
	public void testNoDescription(){
		long test = activity.addItem("Test Item", null, "Misc", il, "01-01-2012", "2", arr);
		assertTrue("Adding an item failed, asks for a description",test == -1);
	}
	
	/**
	 * This will test to make sure the app will not add an item with no category
	 */
	public void testNoCategory(){
		long test = activity.addItem("Test Item", "A J-Unit test item", "empty", il, "01-01-2012", "2", arr);
		assertTrue("Adding an item failed, asks to select a category",test == -1);
	}
	
	/**
	 * This will test to make sure the app will not add an item with no date
	 */
	public void testNoDate(){
		long test = activity.addItem("Test Item", "A J-Unit test item", "Misc", il, null, "2", arr);
		assertTrue("Adding an item failed, asks for a description",test == -1);
	}
	
	/**
	 * This will test to make sure the app will not add an item with no location
	 */
	public void testNoLocation(){
		long test = activity.addItem("Test Item", "A J-Unit test item", "Misc", null, "01-01-2012", "2", arr);
		assertTrue("Adding an item failed, asks for a description",test == -1);
	}
	
	/**
	 * This will test to make sure the app will not add an item with no reward entered
	 */
	public void testNoReward(){
		long test = activity.addItem("Test Item", "A J-Unit test item", "Misc", il, "01-01-2012", null, arr);
		assertTrue("Adding an item failed, asks for a reward", test == -1);
	}
	
}
/*import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


public class ReportLostItemPresenterTest {

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test() {
		fail("Not yet implemented");
	}

}*/